package reader;

import java.util.Set;

import com.shhic.itsed.mws.deviceintf.IReaderResultCallback;
import com.shhic.itsed.mws.deviceintf.RawTagField;
import com.shhic.itsed.mws.deviceintf.RawTagOperationResult;
import com.shhic.itsed.mws.deviceintf.RawTagReadResult;
import com.shhic.itsed.mws.deviceintf.ReaderLinkStatusEnum;

public class ResultCallBack implements IReaderResultCallback {

	public void onResult(RawTagOperationResult result) {
		System.out.println(result.getReaderIp()+":"+((RawTagReadResult)result).getInventoryResult());
		Set<RawTagField> list = ((RawTagReadResult)result).getTagFieldsReadResult();
		for(RawTagField f:list){
			System.out.println(result.getReaderIp()+":"+f.getFieldValue());			
		}
	}

	public void onError(ReaderLinkStatusEnum linkStatus, String errMsg) {
		System.out.println(linkStatus+":"+errMsg);
	}

	public void onIdle() {
		System.out.println("onIdle");
	}

}
